<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link href="<%=path%>/CSS/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<%@ include file="/WEB-INF/JSP/ajax.jsp"%>
<script type="text/javascript"
	src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
<style type="text/css">
.seachform li label {line-height: 45px;color: #444444}
.scinput {line-height: 10px;margin-top: 5px}
.scinput1 {margin-top: 5px;height: 30px;}
.scbtn {background: #57a0ff;border-radius: 20px;width: 110px;margin-top: 4px;height: 35px}
thead {background: #f2f2f2}
.tablelist2 th {height: 45px;background: none;}
.tablelist2 tr{height:45px;}
.tablelist2 tr th{height: 20px;border-left: 1px solid #dddee6;border-right: 1px solid #dddee6;color: #444444;text-align: center;}
.tou{background: #e4eafe}
.kh{border-bottom: 1px solid #dddee6;}
.shuju td{border-left: 1px solid #dddee6;border-right: 1px solid #dddee6;color: #787c88;text-align: center;}
.shuju:nth-child(odd){background: #ffffff}
.shuju:nth-child(even){background: #f3f5fb}
.shuju:last-child{border-bottom: 1px solid #dddee6;}
.shuju:HOVER {
	background: #fff6cd;
}

.scbtn {
	outline: none;
}
</style>
</head>
<body style="background: #f5f5f5;padding: 0 10px;">
	<div class="place" style="background: #f5f5f5; margin-top: 10px">
		<ul class="placeul">
			<li><a href="#">报表</a></li>
			<li><a href="#">财务报表</a></li>
			<li><a href="<%=path%>/DrivingSys/queryStudentStateStatement/look.action">驾校学员考试明细表</a></li>
		</ul>
	</div>

	<div class="rightinfo"
		style="background: #fff; border-radius: 10px; height: 45px;">

		<form action="<%=path%>/DrivingSys/queryStudentStateStatementByInfo" method="post">
			<ul class="seachform">
				<li><label>学员名称</label><input name="name" type="text"
					class="scinput" value="${name}"/></li>
				<li><label>电话号码</label><input name="tel" type="text"
					class="scinput" value="${tel}"/></li>
				<li><label>身份证号</label><input name="cerno" type="text"
					class="scinput" value="${cerno}"/></li>
				<li><label>开始时间</label><input class="scinput1" name="beginTime"
					type="text"
					onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}',dateFmt:'yyyy-MM-dd'})"
					id="datemin" class="input-text Wdate" style="width: 150px;"
					value="${beginTime}"></li>
				<li><label>结束时间</label><input class="scinput1" name="endTime"
                                              type="text"
                                              onfocus="WdatePicker({minDate:'#F{$dp.$D(\'datemin\')}',dateFmt:'yyyy-MM-dd'})"
                                              id="datemax" class="input-text Wdate" style="width: 150px;"
                                              value="${endTime}"></li>
				<li><label>&nbsp;</label><input name="" type="submit"
                                                class="scbtn" value="立即查询"/></li>
                <shiro:hasPermission name="/exportStudentState">
                    <li><label>&nbsp;</label><input name="" type="button" id="dc"
                                                    class="scbtn" value="导出Excel" /></li>
                </shiro:hasPermission>
			</ul>
		</form>
	</div>


	<div style="width: 100%; overflow: auto; margin-bottom: 20px; margin-top: 30px; background: #fff; box-shadow: 0 0 10px #f2f2f2; min-height: 600px">
		<table class="tablelist2" style="width: 100%;"id="table1">
			<thead>
				<tr class="tou">
					<th rowspan="2" style="width: 130px" align="center">编码</th>
					<th rowspan="2" style="width: 50px" align="center">名称</th>
					<th rowspan="2" style="width: 80xp" align="center">入学时间</th>
					<th rowspan="2" style="width: 140px" align="center">身份证号码</th>
					<th rowspan="2" style="width: 90px" align="center">手机</th>
					<th rowspan="2" style="width: 55px" align="center">申领类型</th>
					<th rowspan="2" style="width: 50px" align="center">申请准驾车型代号</th>
					<th rowspan="2" style="width: 70px" align="center">班级</th>
                    <th rowspan="2" style="width: 100px" align="center">学员状态</th>
					<th colspan="3" class="kh">通过时间</th>
					<th colspan="3" class="kh">未通过时间</th>
					<th colspan="3" class="kh">考试次数</th>
					<th colspan="3" class="kh">缺考时间</th>
					<th rowspan="2">备注</th>
				</tr>
				<tr class="tou">
					<th>科目一</th>
					<th>科目二</th>
					<th>科目三</th>
					<th>科目一</th>
					<th>科目二</th>
					<th>科目三</th>
					<th>科目一</th>
					<th>科目二</th>
					<th>科目三</th>
					<th>科目一</th>
					<th>科目二</th>
					<th>科目三</th>
				</tr>
				<c:forEach items="${students}" var="s">
				<tr class="shuju">
					<td>${s.fnumber}</td>
					<td>${s.fnameL2}</td>
					<td>${s.cfrxsj}</td>
					<td>${s.cfidcardno}</td>
					<td>${s.cfsjhm}</td>
					<c:if test="${s.cfsllx == '1'}">
						<td>初次申领</td>
					</c:if>
					<c:if test="${s.cfsllx == '2'}">
						<td>增加准驾车型</td>
					</c:if>
					<c:if test="${s.cfsllx == '3'}">
						<td>持军官驾驶证</td>
					</c:if>
					<c:if test="${s.cfsllx == '4'}">
						<td>持境外驾驶证</td>
					</c:if>
					<c:if test="${empty s.cfsllx}">
						<td></td>
					</c:if>
					<td>${s.cfslzjcxdh}</td>
					<td>${s.cfclazzName}</td>
					<c:if test="${s.cfstudentstate eq 1}">
                          <td>已报名</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 2}">
                          <td>科目一通过</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 3}">
                          <td>科目一未通过</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 4}">
                        <td>科目二通过,科目三未开始</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 5}">
                        <td>科目二未通过,科目三未开始</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 6}">
                        <td>科目二练车中,科目三未开始</td>
                     </c:if>
                    <c:if test="${s.cfstudentstate eq 7}">
                        <td>科目三通过,科目二通过</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 8}">
                        <td>科目三未通过,科目二通过</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 9}">
                        <td>科目三练车中,科目二通过</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 10}">
                          <td>已结业</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 11}">
                          <td>已退学</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 12}">
                          <td>模拟考试合格</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 13}">
                          <td>已过期</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 14}">
                          <td>作废</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 15}">
                        <td>科目三练车中,科目二未通过</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 16}">
                        <td>科目三练车中,科目二未开始</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 17}">
                        <td>科目三通过,科目二未通过</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 18}">
                        <td>科目三通过,科目二练车中</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 19}">
                        <td>科目三通过,科目二未开始</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 20}">
                        <td>科目二未通过,科目三未通过</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 21}">
                        <td>科目三未通过，科目二未开始</td>
                    </c:if>
                    <c:if test="${s.cfstudentstate eq 22}">
                        <td>科目二练车中,科目三未通过</td>
                    </c:if>
                    <c:if test="${empty s.cfstudentstate}">
                          <td></td>
                    </c:if>
					<td>${s.cfkmyherq}</td>
					<td>${s.cfkmehgrq}</td>
					<td>${s.cfkmshgrq}</td>
					<td>${s.cfkmybjgsj}</td>
					<td>${s.cfkmebjgsj}</td>
					<td>${s.cfkmsbjgsj}</td>
					<td>${s.cfkmykss}</td>
					<td>${s.cfkmekss}</td>
					<td>${s.cfkmskss}</td>
					<td>${s.cfkmyksqksj}</td>
					<td>${s.cfkmeksqksj}</td>
					<td>${s.cfkmsksqksj}</td>
					<td>${s.cfdesc}</td>
				</tr>
				</c:forEach>
		</table>
	</div>
	<pg:pager items="${pb.tr}" url="${pb.url}" export="offset,currentPageNumber=pageNumber" maxPageItems="${pb.ps}">
			   <pg:param name="name" value="${name}"/> 
			   <pg:param name="tel" value="${tel}"/> 
			   <pg:param name="cerno" value="${cerno}"/> 
    		   <pg:param name="beginTime" value="${beginTime}"/> 
    		   <pg:param name="endTime" value="${endTime}"/>  
		<pg:index>
			<pg:first>
				<a href="${pageUrl}&&type=${type}"> <nobr> [首页] </nobr>
				</a>
			</pg:first>
			<pg:prev>
				<a href="${pageUrl}&&type=${type}">前一页</a>
			</pg:prev>
			<pg:pages>
				<c:choose>
					<c:when test="${currentPageNumber eq pageNumber}">
						<font color="red">${pageNumber }</font>
					</c:when>
					<c:otherwise>
						<a href="${pageUrl}&&type=${type}">${pageNumber}</a>
					</c:otherwise>
				</c:choose>
			</pg:pages>
			<pg:next>
				<a href="${pageUrl}&&type=${type}">下一页</a>
			</pg:next>
			<pg:last>
				<a href="${pageUrl}&&type=${type}"><nobr>[尾页]</nobr></a>
			</pg:last>
		</pg:index>
	</pg:pager>
	<div style="height: 20px"></div>
</body>
<script type="text/javascript">
$("#dc").live('click',function(){
	var psql="${psql}";
	//避免字符串出现空格
	var goodTemplate1 = psql.replace(/\%/g,'%25');
	 location = '<%=path%>/DrivingSys/exportStudentState?psql2='+goodTemplate1+'';
	  /* $.ajax({  
        url :"exportStudentState",  
        async :false,  
        type :"post",  
        dataType :"text",  
        data : {"psql2":goodTemplate1}, 
        sueecss:function(C){
        	alert(C)
        },
        error : function(C) {  
           alert("导出失败")  
        },  
	 })    */  
})
</script>
</html>